﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace VietThuongLMS
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute(
                "TinTuc",                                           // Route name
                "TinTuc",                            // URL with parameters
                new { controller = "Home", action = "TinTuc" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "Album",                                           // Route name
                "Album",                            // URL with parameters
                new { controller = "Home", action = "Album" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "HoatDong",                                           // Route name
                "HoatDong/{id}/{type}",                            // URL with parameters
                new { controller = "Home", action = "HoatDong", id = UrlParameter.Optional, type = UrlParameter.Optional },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "FAQ",                                           // Route name
                "FAQ",                            // URL with parameters
                new { controller = "Home", action = "FAQ" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "ChiNhanh",                                           // Route name
                "ChiNhanh",                            // URL with parameters
                new { controller = "Home", action = "ChiNhanh" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "LienHe",                                           // Route name
                "LienHe",                            // URL with parameters
                new { controller = "Home", action = "LienHe" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "DangNhap",                                           // Route name
                "DangNhap",                            // URL with parameters
                new { controller = "Home", action = "DangNhap" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "Thoat",                                           // Route name
                "Thoat",                            // URL with parameters
                new { controller = "Home", action = "Thoat" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "DangKy",                                           // Route name
                "DangKy",                            // URL with parameters
                new { controller = "Home", action = "DangKy" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "GioiThieu",                                           // Route name
                "GioiThieu",                            // URL with parameters
                new { controller = "Home", action = "GioiThieu" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "GiaoVien",                                           // Route name
                "GiaoVien",                            // URL with parameters
                new { controller = "Home", action = "GiaoVien" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "ThongTinGiaoVien",                                           // Route name
                "ThongTinGiaoVien/{id}",                            // URL with parameters
                new { controller = "Home", action = "ThongTinGiaoVien", id = UrlParameter.Optional },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "ThongTinHocVien",                                           // Route name
                "ThongTinHocVien",                            // URL with parameters
                new { controller = "Home", action = "ThongTinHocVien" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "ThongTinLop",                                           // Route name
                "ThongTinLop",                            // URL with parameters
                new { controller = "Home", action = "ThongTinLop" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "DiemDanh",                                           // Route name
                "DiemDanh",                            // URL with parameters
                new { controller = "Home", action = "DiemDanh" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "DoiMatKhau",                                           // Route name
                "DoiMatKhau",                            // URL with parameters
                new { controller = "Home", action = "DoiMatKhau" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "KhoaHoc",                                           // Route name
                "KhoaHoc",                            // URL with parameters
                new { controller = "Home", action = "KhoaHoc" },  // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "DangKyStep2",                                           // Route name
                "DangKyStep2/{id}",                            // URL with parameters
                new { controller = "Home", action = "DangKyStep2", id = UrlParameter.Optional }, // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "TimKiemAlbum",                                           // Route name
                "TimKiemAlbum/{tag}",                            // URL with parameters
                new { controller = "Home", action = "AlbumSearch", tag = UrlParameter.Optional }, // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "ChiTietTinTuc",                                           // Route name
                "ChiTietTinTuc/{id}",                            // URL with parameters
                new { controller = "Home", action = "TinTucDetail", id = UrlParameter.Optional }, // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "TinTucThang",                                           // Route name
                "TinTucThang/{id}",                            // URL with parameters
                new { controller = "Home", action = "TinTucThang", id = UrlParameter.Optional }, // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
                new[] { "VietThuongLMS.Controllers" }
            );

        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
        }

        
    }
}